#include "backuppositionselectdialog.h"
#include "filefilterproxymodelforbackup.h"
#include "../../common/utils.h"

BackupPositionSelectDialog::BackupPositionSelectDialog(QWidget* parent) :
    QFileDialog(parent)
{
    setWindowTitle(tr("Please select a path"));
    setViewMode(QFileDialog::Detail);
    setFileMode(QFileDialog::DirectoryOnly);
    setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
    QList<QUrl> siderUrls;
    siderUrls << QUrl::fromLocalFile(Utils::getSysRootPath());
    siderUrls << QUrl::fromLocalFile(Utils::getSysRootPath() + "/data");
    QList<QString> localDisks = Utils::getLocalDisks();
    for (const QString& path: localDisks) {
        siderUrls << QUrl::fromLocalFile(path);
    }
    setSidebarUrls(siderUrls);
    FileFilterProxyModeForBackup *proxy = new FileFilterProxyModeForBackup;
    setProxyModel(proxy);
}

BackupPositionSelectDialog::~BackupPositionSelectDialog()
{}

